@import (less) "less/index.less";

// Import all base styles
@import (less) "base/index.less";

// layout rules
@import (less) "layout/index.less";

// Components (modules) in order of appearance on page
@import (less) "components/header.less";
@import (less) "components/carousel.less";
@import (less) "components/home.less";
@import (less) "components/footer.less";

@highlight-color: @blue;

@keyframes pulse {
  0% { opacity: 0; }
  100% { opacity: .95; }
}

@keyframes slideUp {
  0% { transform: translateY(50%); opacity: .5; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes shiftRight {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}

#page-barcodescanner {
  position: relative;
}
#interactive.viewport {
  position: relative;
  width: 100%;
  video, canvas {
    width: 100%;
    height: 100vh;
    object-fit: cover;
  }
  canvas {
    position: absolute;
    top: 0;
    left:0;
  }
}
#result-strip {
  font-family: @lucida_sans_serif-1;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  position: absolute;
  bottom: 0;
  background: fade(@white, 90%);
  width: 100%;
  padding: 10px;
  .empty {
    display: none;
    &:first-child:last-child { display: flex; }
    width: 80vw;
    max-width: 300px;
    height: 80px;
    border: 1px dashed;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 4px;
  }
}
.lazy-book-card {
  background: @white;
  flex-shrink: 0;
  margin-right: 6px;
  width: 80vw;
  max-width: 300px;
  height: 120px;
  border: 1px solid @light-mid-grey;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  color: @black;
  text-decoration: none;
  position: relative;
  transition-property: background-color border-color;
  transition-duration: .2s;
  &:first-child { animation: slideUp .8s; }
  &:nth-child(2) { animation: shiftRight .8s; }
  &:hover {
    background: lighten(@blue, 45%);
    border-color: lighten(@blue, 15%);
  }
  &::before {
    display: none;
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 100px;
    margin: 10px;
    right: 0;
  }
  &.loading::before {
    display: block;
    background: @blue;
    opacity: 0;
    animation: pulse .5s infinite alternate;
    // Only show loading animation if it takes
    // longer than this
    animation-delay: .5s;
  }
  &.errored::before {
    display: block;
    background: @red;
  }
  .title { font-weight: bold; font-size: 1.2em; }
  .cover {
    width: 25%;
    img { width: 100%; height: 100%; object-fit: cover; }
  }
  .identifier {
    margin-top: 4px;
    padding-top: 4px;
    color: @grey-555;
    border-top: 1px dotted;
  }
  .info {
    flex: 1;
    padding: 8px;
  }
}
